#include "pch.h"

using std::initializer_list;
using std::string;

Cutoffs::~Cutoffs() {
	for (auto & iter : cuts) {
		delete iter.second;
	}
}

CutoffInterface * Cutoffs::getIns(const string & name) {
	static Cutoffs ins;

	if (ins.cuts.find(name) == ins.cuts.end()) {
		if (name == "ICCutoff") {
			ins.cuts[name] = new ICCutoff();
		}
		else if (name == "TwoDistanceCutoff") {
			ins.cuts[name] = new TwoDistanceCutoff();
		}
		else if (name == "AdjacentCutoff") {
			ins.cuts[name] = new AdjacentCutoff();
		}
		else if (name == "ZobristCutoff") {
			ins.cuts[name] = new ZobristCutoff();
		}
	}

	return ins.cuts[name];
}